package com.example.test.serviceImpl;

import com.example.test.bean.UserBean;
import com.example.test.mapper.UserMapper;
import com.example.test.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    UserMapper userMapper;

    @Override
    public UserBean loginAction(String name, String password) {
        return userMapper.getInfo(name, password);
    }

    @Override
    public List<UserBean> getAllUser(){
        return userMapper.getALLUser();
    }

    @Override
    public int insertUser(UserBean userBean) {
        return userMapper.insertUser(userBean);
    }

    public int deleteUser(String id){
        return userMapper.deleteUser(id);
    }

    @Override
    public  UserBean getUserById(String id){
        return userMapper.getUserById(id);
    }
}
